fix: ensure checkUpgrade sets init:#5040
Merged
rekram1-node merged 1 commit intoanomalyco:devfrom Dec 4, 2025
Merged
Conversation
7dfd48a to
aa371dd
Compare
Collaborator
|
@code-yeongyu is the issue actually w/ plugin init? Or is the issue with how check upgrade is working? Because it kinda sounds like the later but maybe I misunderstand the issue |
aa371dd to
2cf2805
Compare
Contributor
Author
|
You're right. I initially misunderstood the flow and tried to make |
init:
Collaborator
|
good find, thanks! |
shuv1337
added a commit
to Latitudes-Dev/shuvcode
that referenced
this pull request
Dec 4, 2025
* fix: ensure checkUpgrade sets `init:` (anomalyco#5040) * chore: format code * ci: use blacksmith runners in review workflow too (anomalyco#5042) * zen: make session provider sticky * ci: only maintainer can trigger * ci: cleaner * ignore: update download stats 2025-12-04 * fix(tui): cursor color * Preserve prompt input when creating new session (anomalyco#4993) * fix: model not being passed correctly to tool * tweak: bash tool messages regarding timeouts and truncation more clear for agent (anomalyco#5066) * tui: fix /new slash command being persisted in prompt input * add optional prompt Input to Github Action (anomalyco#4828) Co-authored-by: Github Action <[email protected]> Co-authored-by: Aiden Cline <[email protected]> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> * bump: builtin plugin versions * feat: Add SAP AI Core provider support (anomalyco#5023) Signed-off-by: Jérôme Benoit <[email protected]> * core: ensure model npm package falls back to dev models config when not explicitly defined * docs: add CodeCompanion.nvim integration instructions (anomalyco#5079) * tweak: bash tool description re commit stuff * core: add test for custom model npm package inheritance * feat(desktop): terminal pane (anomalyco#5081) Co-authored-by: Github Action <[email protected]> Co-authored-by: Dax Raad <[email protected]> * Revert "feat(desktop): terminal pane (anomalyco#5081)" This reverts commit d763c11. * release: v1.0.133 * sync: record last synced tag v1.0.133 --------- Signed-off-by: Jérôme Benoit <[email protected]> Co-authored-by: YeonGyu-Kim <[email protected]> Co-authored-by: GitHub Action <[email protected]> Co-authored-by: wsx99outlook <[email protected]> Co-authored-by: Frank <[email protected]> Co-authored-by: Aiden Cline <[email protected]> Co-authored-by: Adam <[email protected]> Co-authored-by: Daniel Gray <[email protected]> Co-authored-by: Shantur Rathore <[email protected]> Co-authored-by: Daniel Polito <[email protected]> Co-authored-by: Aiden Cline <[email protected]> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: Jérôme Benoit <[email protected]> Co-authored-by: Dax Raad <[email protected]> Co-authored-by: Cason Adams <[email protected]> Co-authored-by: opencode <[email protected]>
shuv1337
added a commit
to Latitudes-Dev/shuvcode
that referenced
this pull request
Dec 5, 2025
* fix: ensure checkUpgrade sets `init:` (anomalyco#5040) * chore: format code * ci: use blacksmith runners in review workflow too (anomalyco#5042) * zen: make session provider sticky * ci: only maintainer can trigger * ci: cleaner * ignore: update download stats 2025-12-04 * fix(tui): cursor color * Preserve prompt input when creating new session (anomalyco#4993) * fix: model not being passed correctly to tool * tweak: bash tool messages regarding timeouts and truncation more clear for agent (anomalyco#5066) * tui: fix /new slash command being persisted in prompt input * add optional prompt Input to Github Action (anomalyco#4828) Co-authored-by: Github Action <[email protected]> Co-authored-by: Aiden Cline <[email protected]> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> * bump: builtin plugin versions * feat: Add SAP AI Core provider support (anomalyco#5023) Signed-off-by: Jérôme Benoit <[email protected]> * core: ensure model npm package falls back to dev models config when not explicitly defined * docs: add CodeCompanion.nvim integration instructions (anomalyco#5079) * tweak: bash tool description re commit stuff * core: add test for custom model npm package inheritance * feat(desktop): terminal pane (anomalyco#5081) Co-authored-by: Github Action <[email protected]> Co-authored-by: Dax Raad <[email protected]> * Revert "feat(desktop): terminal pane (anomalyco#5081)" This reverts commit d763c11. * release: v1.0.133 * Update Nix flake.lock and hashes * Reapply "feat(desktop): terminal pane (anomalyco#5081)" This reverts commit f9dcd97. * chore: format code * Update Nix flake.lock and hashes * zen: fix byok * ignore: fix provider credentials query for BYOK Provider credentials field was being selected from ProviderTable even when the table wasn't joined (when byokProvider was undefined). Now the join is conditional - when byokProvider exists, we join and get the credentials; when it doesn't, the join condition is always false so provider remains null. * docs: llama.cpp docs: `limit` moved under model (anomalyco#5089) Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: GitHub Action <[email protected]> * fix: add getModel to SAP AI Core provider for correct SDK initialization (anomalyco#5086) Signed-off-by: Jérôme Benoit <[email protected]> * fix pty builds * fix * increase default scroll speed * ci: review * fix: ensure that vcs is still set to git even if no commits in repo * ignore: rm slop commnand (only for opencode repo this isnt shipping) * chore: format code * ignore: cmd tweak * tui: wrap dialog option descriptions (anomalyco#5083) * ci: keybinds * fix: ensure projects that go from having no commits to having commits have sessions migrated (anomalyco#5105) Co-authored-by: GitHub Action <[email protected]> * ignore: tweak * ignore: update download stats 2025-12-05 * Zen: add codex max * do not use required pty for local dev * fix: anomalyco#5064 ProviderInitError github-copilot-enterprise (anomalyco#5123) * feat(theme): Vercel (anomalyco#5119) Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: rekram1-node <[email protected]> * fix(desktop): new session not selecting tab * fix(desktop): clone pty session on reconnect * add experimental.open_telemetry config option to enable OTEL spans (anomalyco#4978) Co-authored-by: noamzbr <[email protected]> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: rekram1-node <[email protected]> * ignore: regen sdk * fix(desktop): prompting * fix(desktop): terminal cursor position * feat: add max steps for supervisor and sub-agents (anomalyco#4062) Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: rekram1-node <[email protected]> * tweak: bash tool improve output metadata for agent consumption, fix small timeout issue (anomalyco#5131) * OpenCode Desktop app (anomalyco#5044) Co-authored-by: Adam <[email protected]> * Update Nix flake.lock and hashes * release: v1.0.134 * sync: record last synced tag v1.0.134 * chore: format code --------- Signed-off-by: Jérôme Benoit <[email protected]> Co-authored-by: YeonGyu-Kim <[email protected]> Co-authored-by: GitHub Action <[email protected]> Co-authored-by: wsx99outlook <[email protected]> Co-authored-by: Frank <[email protected]> Co-authored-by: Aiden Cline <[email protected]> Co-authored-by: Adam <[email protected]> Co-authored-by: Daniel Gray <[email protected]> Co-authored-by: Shantur Rathore <[email protected]> Co-authored-by: Daniel Polito <[email protected]> Co-authored-by: Aiden Cline <[email protected]> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: Jérôme Benoit <[email protected]> Co-authored-by: Dax Raad <[email protected]> Co-authored-by: Cason Adams <[email protected]> Co-authored-by: opencode <[email protected]> Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com> Co-authored-by: ry2009 <[email protected]> Co-authored-by: Julian Visser <[email protected]> Co-authored-by: Anthony Shew <[email protected]> Co-authored-by: rekram1-node <[email protected]> Co-authored-by: Noam Bressler <[email protected]> Co-authored-by: noamzbr <[email protected]> Co-authored-by: Nathan Thomas <[email protected]> Co-authored-by: Brendan Allan <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In TUI mode, a race condition occurs in environments where initialization involves significant latency (e.g., SSH, WSL2, remote VSCode).
The
checkUpgradefunction is scheduled to execute after 1 second. If the TUI initialization phase takes longer than 1 second,checkUpgradeexecutes first. Previously,checkUpgradecalledInstance.provide()without passing theinit(InstanceBootstrap) object.Found this and fixed this using my personal plugin oh-my-opencode, but i thought there is no ai slop for this and found the real cause and fixed so I made this PR.
Root Cause
The
Instance.provide()method follows a singleton pattern with caching.checkUpgradeexecutes and callsInstance.provide()(withoutinit).Instanceis created using default settings without executing configuration or event hooks, and this uninitialized instance is cached.Instance.provide(init), the system detects the cached instance.initobject.Impact:
Solution
Updated
checkUpgradeinpackages/opencode/src/cli/cmd/tui/worker.tsto accept and pass theinit: InstanceBootstrapobject.Now, regardless of whether
checkUpgradeor the main TUI loop wins the race to create theInstance, the singleton is guaranteed to be initialized with the correct configuration and hooks.Reproduction
checkUpgraderuns.configare missing or event handlers are not triggering.Related
Closes #4846